package com.oil.petro.eshop.utils;

import com.oil.petro.eshop.bean.BasicBean;
import com.oil.petro.eshop.entity.Category;
import com.oil.petro.eshop.entity.Manufacturer;
import com.oil.petro.eshop.service.CategoryService;
import com.oil.petro.eshop.service.ManufacturerService;
import com.oil.petro.eshop.service.ProductService;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;
import org.springframework.ui.Model;

public class NavigationMenu {

    public void getNavigationMenuDataModel(Map<String, Object> model,
            CategoryService categoryService, ManufacturerService manufacturerService) {

        // SecurityContextHolderAwareRequestWrapper.isUserInRole("s");
        List<Manufacturer> manufacturerList = manufacturerService.getManufacturerList();
        List<Category> categoryList = categoryService.getCategoryList();
        model.put("manufacturerList", manufacturerList);
        model.put("categoryList", categoryList);
        model.put("costList", Price.getPricePickerList());
    }

    public void getNavigationMenuDataModel(Model model,
            CategoryService categoryService, ManufacturerService manufacturerService) {

        // SecurityContextHolderAwareRequestWrapper.isUserInRole("s");
        List<Manufacturer> manufacturerList = manufacturerService.getManufacturerList();
        List<Category> categoryList = categoryService.getCategoryList();
        model.addAttribute("manufacturerList", manufacturerList);
        model.addAttribute("categoryList", categoryList);
        model.addAttribute("costList", Price.getPricePickerList());
    }

//    private void getNavigationMenuDataModelSubmit(Map<String, Object> model, BasicBean basicBean, boolean emptySearchResult, int pageStatus) {
//
//        // SecurityContextHolderAwareRequestWrapper.isUserInRole("s");
//        List<Manufacturer> manufacturerList = manufacturerService.getManufacturerList();
//        List<Category> categoryList = categoryService.getCategoryList();
//        model.put("manufacturerList", manufacturerList);
//        model.put("categoryList", categoryList);
//        model.put("costList", Price.getPricePickerList());
//
//        model.put("commandBean", basicBean);
//        model.put("emptySearchResult", emptySearchResult);
//    }
}
